    //
    //  CheckInTask.m
    //  ZooNgonDoiOS
    //
    //  Created by Anh Jun Linh Tinh on 6/22/12.
    //  Copyright (c) 2012 Personal. All rights reserved.
    //

#import "CheckInTask.h"
#import "RKRequest.h"
#import "NKCheckInBean.h"
#import "RKRequestSerialization.h"

@implementation CheckInTask

-(id)initWithSpotId:(NSString *)spotId{  
    self = [self initWithSpotId:spotId dishesId:[[NSArray alloc] init]] ;
    return self;
}

-(id) initWithSpotId:(NSString *)spotId dishesId:(NSArray *)dishesId{
    self = [super init];
    if(self){
        _spotId = spotId;
        _dishedId = dishesId;
    }
    return self;
}

-(void) doExcute{

    
//    NSMutableDictionary *paramDic = [[NSMutableDictionary alloc] init];
    
    NSDictionary *dic = [NSDictionary dictionaryWithKeysAndObjects:@"spot_id",@"4f95350533929a9b0f000000",nil];
//    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:0 error:nil];
//    NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
    
//    RKParams *params = [RKParams paramsWithDictionary:dic];

//    keyvalue.value = @"4f95350533929a9b0f000000";
//     [[RKObjectManager sharedManager] putObject:keyvalue delegate:self];
//    [[RKObjectManager sharedManager].client put:@"/spot/checkin/" params:params delegate:self];
    [[RKObjectManager sharedManager].client put:@"/spot/checkin/" usingBlock:^(RKRequest *request){
        request.params = dic;
        request.delegate = self;
    }];
}

-(void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects{
    NSLog(@"OK men check in");
}

@end
